package Games;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Ellipse2D;

import Client.GraphicPiece;

public class WhitePiece implements GraphicPiece {

	final static BasicStroke wideStroke = new BasicStroke(2.0f);
	private int x, y, width, height;
	private int padding = 2;
	
	public WhitePiece(int x, int y, int width, int height) 
	{
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height; 
		init();
	}
	
	public void init()
	{
		x = ((int) Math.floor((x * width))) + padding;
		y = (int) Math.floor((y * height)) + padding;
		
		width = width - 2*padding;
		height = height - 2*padding;
	}
	
	@Override
	public void draw(Graphics g) {
		
		Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setPaint(Color.gray);
        g2.setStroke(wideStroke);
        g2.draw(new Ellipse2D.Double(x, y, width, height));
	}

}
